package cn.gson.crm.controller.job;

import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import cn.gson.crm.controller.BaseServlet;
import cn.gson.crm.model.dao.EmploDao;
import cn.gson.crm.model.dao.StudentDao;
import cn.gson.crm.model.entity.Student;

@WebServlet("/student/file")
public class FileStudentDetailServlet extends BaseServlet{
	/**
	 * 归档学员关系维护
	 */
	private static final long serialVersionUID = 1L;
	private StudentDao stuDao = new StudentDao();
	private EmploDao empDao = new EmploDao();

	@Override
	protected void get(HttpServletRequest request, HttpServletResponse response) throws Exception {
		String id = request.getParameter("id");
		//获取学生详情
		Student stuDetail = stuDao.getStudentById("正常", "已分配", Integer.parseInt(id));
		String counName = empDao.emploGetById("正常", stuDetail.getCounselorId()).getUserName();
		
		request.setAttribute("stuDetail", stuDetail);
		request.setAttribute("counName", counName);
		//获取维护跟进记录
		//jsp界面跳转
		getServletPathAndForward(request, "student/file_student_detail.jsp");
	}
}
